import { ctcssSsoRequest } from '@core/utils/request';

export default class SsoRole {
  static fetchList = () => {
    return ctcssSsoRequest.get<null, Array<{ authRoleId: number, roleName: string }>>('/standalone/sso/role/list');
  };

  static createOne = (params: { roleName: string }) => {
    return ctcssSsoRequest.get<any, null>('/standalone/sso/role/add', { params });
  };

  static updateOne = (params: { roleId: string | number, roleName: string }) => {
    return ctcssSsoRequest.get<any, null>('/standalone/sso/role/update', { params });
  };

  static deleteOne = (roleId: string | number) => {
    return ctcssSsoRequest.get('/standalone/sso/role/delete', { params: { roleId } });
  };
}
